package com.ny.service.Impl;

import com.ny.entity.Reservations;
import com.ny.mapper.ReservationMapper;
import com.ny.service.ReservationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ReservationServiceImpl implements ReservationService {
    @Autowired
    private ReservationMapper reservationMapper;
    @Override
    public void addReservation(Reservations reservation) {
        reservationMapper.addReservation(reservation);
    }

    //管理员数据库查询操作
    @Override
    public List<Reservations> findAllReservations() {
        return reservationMapper.findAllReservations();
    }

    //管理员审批
    public void updateReservationStatus(int reservationId, String status, String rejectReason) {
        reservationMapper.updateReservationStatus(reservationId, status, rejectReason);
    }

}
